﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using YKhoa_Lib.DAL;

namespace YKhoa_Lib.BLL
{
    public class DichVu
    {
        private string _maDV;
        public string MaDV { get { return _maDV; } set { _maDV = value; } }
        private string _tenDV;
        public string TenDV { get { return _tenDV; } set { _tenDV = value; } }
        private string _maKhoa;
        public string MaKhoa { get { return _maKhoa; } set { _maKhoa = value; } }
        private string _maNhom;
        public string MaNhom { get { return _maNhom; } set { _maNhom = value; } }
        private double _donGia;
        public double DonGia { get { return _donGia; } set { _donGia = value; } }
        private DAL_DichVu dal_DichVu;
        public DichVu()
        {
            dal_DichVu = new DAL_DichVu();
        }

        public List<DichVu> LoadChiTietDichVu()
        {
            DataTable dt = dal_DichVu.LoadChiTietDichVu(MaKhoa, MaNhom);
            List<DichVu> lst = new List<DichVu>();            
            DichVu dv = null;
            foreach(DataRow row in dt.Rows)
            {
                dv = new DichVu();
                dv._maDV = Factory.emptyNull(row["MaDV"]);
                dv._tenDV = Factory.emptyNull(row["TenDichVu"]);
                dv._donGia = double.Parse(row["ThuPhi"].ToString());
                lst.Add(dv);
            }
            return lst;
        }

        
    }
}